﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="SeguiminentoAuditorias.aspx.cs" Inherits="SOA_AnalisisSOA_SeguiminentoAuditorias" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

    <script runat="server">
        protected void ReloadData(object sender, DirectEventArgs e)
        {

        }
    </script>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">

    <script type="text/javascript">
        if (window.dialogArguments) {
            window.opener = window.dialogArguments;
        }
        function tipRenderer(storeItem, item) {
            //calculate percentage.
            var total = 0;

            App.Chart1.getStore().each(function (rec) {
                total += rec.get('Data1');
            });

            this.setTitle(storeItem.get('Name') + ': ' + Math.round(storeItem.get('Data1') / total * 100) + '%');
        }

        function saveChart(btn) {
            Ext.MessageBox.confirm('Confirm Download', 'Would you like to download the chart as an image?', function (choice) {
                if (choice == 'yes') {
                    btn.up('panel').down('chart').save({
                        type: 'image/png'
                    });
                }
            });
        }

    </script>
 
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>

    </ContentTemplate>
</asp:UpdatePanel>

<div id="contenedor800">

    <table border = "0" cellpadding = "0" cellspacing = "0" style="width:100%">
        <tr>
            <td>
                <asp:Label ID="Label1" runat="server" Text=":: Dashboard - Rendimiento Sociedad de Auditoría"  SkinID="labelsubTituloSkin"></asp:Label>            
            </td>
        </tr>
        <tr>
            <td style="height:10px"></td>
        </tr>
    </table>

        <ext:ResourceManager ID="ResourceManager1" runat="server"/>
        <table border = "0" cellpadding = "0" cellspacing = "0" style="width:100%">
            <tr>
                <td>
        <!-- Grafico 01 -->
            <ext:Panel ID="Panel1"
                runat="server"
                Width="370"
                Height="200"
                Title="Estado de Auditorías"
                Layout="FitLayout">
                <TopBar>
                    <ext:Toolbar ID="Toolbar1" runat="server">
                        <Items>
                            <ext:Button ID="Button1" 
                                runat="server" 
                                Text="Reload Data" 
                                Icon="ArrowRefresh" 
                                OnDirectClick="ReloadData" 
                                />
                            <ext:Button ID="Button2" runat="server" Text="Donut" EnableToggle="true">
                                <Listeners>
                                    <Toggle Handler="#{Chart1}.series.first().donut = pressed ? 35 : false;#{Chart1}.refresh();" />
                                </Listeners>
                            </ext:Button>

                            <ext:Button ID="Button3" 
                                runat="server" 
                                Text="Save Chart" 
                                Icon="Disk"
                                Handler="saveChart"
                                />
                        </Items>
                    </ext:Toolbar>
                </TopBar>

                <Items>
                    <ext:Image ID="Image1" runat="server" ImageUrl="~/imagenes/img_01.png">
                    </ext:Image>
              </Items>
            </ext:Panel>                
                </td> 
                <td style="width:20px">                
                </td> 
                <td>
        <!-- Grafico 02 -->
            <ext:Panel ID="Panel2"
                runat="server"
                Width="370"
                Height="200"
                Title="Auditorías e Informes de Control"
                Layout="FitLayout">
                <TopBar>
                    <ext:Toolbar ID="Toolbar2" runat="server">
                        <Items>
                            <ext:Button ID="Button4" 
                                runat="server" 
                                Text="Reload Data" 
                                Icon="ArrowRefresh" 
                                OnDirectClick="ReloadData" 
                                />
                            <ext:Button ID="Button5" runat="server" Text="Donut" EnableToggle="true">
                                <Listeners>
                                    <Toggle Handler="#{Chart1}.series.first().donut = pressed ? 35 : false;#{Chart1}.refresh();" />
                                </Listeners>
                            </ext:Button>

                            <ext:Button ID="Button6" 
                                runat="server" 
                                Text="Save Chart" 
                                Icon="Disk"
                                Handler="saveChart"
                                />
                        </Items>
                    </ext:Toolbar>
                </TopBar>

                <Items>
                    <ext:Image ID="Image2" runat="server" ImageUrl="~/imagenes/img_02.png">
                    </ext:Image>
              </Items>
            </ext:Panel>                
                </td>                                                
            </tr>
        </table>

    <table border = "0" cellpadding = "0" cellspacing = "0" style="width:100%">
        <tr>
            <td style="height:200px"></td>
        </tr>
    </table>
</div>

</asp:Content>

